<template>
  <div id="app">
    <projecthead @func="getMsgFromSon"/>
    <projectnav @func="getMsgFromSon" v-show="currentRole!='login' && currentRole!='register' "/>
    <!--展示页面的标签-->
    <component :is="currentRole" @func="getMsgFromSon"/>
    <projectfooter @func="getMsgFromSon"/>
    <!--<userinfo />-->
    <!--<usermaterial />-->
    <!--<usermanagent />-->
    <!--<userpassword />-->
    <!--<mymoney />-->
    <!--<mycharge />-->
    <!--修改该页面-->
    <!--<mydraw />-->
    <!--<mydepositsHistory/>-->
    <!--<mybankSet />-->
    <!--<myborrowHistory />-->
    <!--<myshopping />-->
    <!--<myintegration />-->
    <!--<mymessage />-->
    <!--<myrepay />-->

    <!--<depositsHistory />-->
  </div>
</template>

<script>
  import login from './components/login'
  import register from './components/register'
  import problem from './components/problem'
  import noticelist from './components/noticelist'
  import invest from './components/invest'
  import projecthead from './components/projecthead'
  import projectfooter from "./components/projectfooter";
  import detail from "./components/detail";
  import projectnav from "./components/projectnav";
  import borrow from "./components/borrow"
  import index2 from "./components/index2"
  import settings from "./components/settings";
  import shows from "./components/shows"
  import news from "./components/news";
  import gaodemap from "./components/gaodemap";
  import 'element-ui/lib/theme-chalk/index.css'
  import bus from "./assets/eventBus";

export default {
  name:'app',
  components: {
    login,register,problem,noticelist,invest,projecthead,projectfooter,detail,projectnav,borrow,index2,settings,shows,news,gaodemap
  },
  data(){
    return{
      currentRole: "index2",
      sonRefresh:true,
    }
  },
  methods: {
    getMsgFromSon: function (param) {
      this.currentRole=param;
      this.sonRefresh=false
      this.sonRefresh=true
      // alert(this.currentRole)
    }
  },
  mounted() {
    bus.$on('changeModule',(e)=>{
      this.currentRole = e;
    })
    window.addEventListener('beforeunload', e => {
      localStorage.token = 0;
    });
  },
}
</script>

<style>
/*#app {*/
/*  font-family: 'Avenir', Helvetica, Arial, sans-serif;*/
/*  -webkit-font-smoothing: antialiased;*/
/*  -moz-osx-font-smoothing: grayscale;*/
/*  text-align: center;*/
/*  color: #2c3e50;*/
/*  margin-top: 60px;*/
/*}*/
@import "./assets/css/style.css";
</style>
